<template>
	<view class="container">
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">心理指导</block>
		</cu-custom>
		
		<view class="bannerBox">
			<image mode="widthFix" src="http://xinli.g60health.com:8000/xinliimg/111.png"></image>
		</view>
		
		<view>
			<view class="cu-bar bg-white margin-top-xs">
				<view class="action sub-title">
					<text class="text-xl text-bold text-blue text-shadow">心理指导</text>
					<text class="text-ABC text-blue">psychology</text>
				</view> 
			</view>
			<view v-for="(item1, index1) in dataL">
			<view v-for="(item, index) in item1" class="cu-list menu sm-border margin-bottom ">
				<view class="cu-item">
					<view class="content padding-tb-sm">
						<view class="text-xl">
							<text class="cuIcon-text text-blue margin-right-xs"></text>
							{{item.name}}
						</view>
						<view class="text-gray text-df margin-top-xs">
							<text class="cuIcon-hotfill margin-right-xs"></text>
							已有{{item.num}}位用户已使用
						</view>
					</view>
					<view class="action">
						<button v-if="item.isAnswer != 2" @click="goIndex(item.id)" class="cu-btn round bg-gradual-blue shadow">开始</button>
						<!-- <button v-if="item.isAnswer == 2" @click="goIndex(item.id)" class="cu-btn round bg-gradual-orange shadow">已经答题</button> -->
					</view>
				</view>
			</view>
			</view>

			
		</view>
			<view style="height: 140rpx;width: 1rpx;"></view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				dataL: {
					data1: [
						{
								id: '1',
								name: '心理量表',
								num:'31',
								isAnswer: 1
						},{
							id: '2',
							name: '正念疗法',
							num:'31',
							isAnswer: 1
					}]
				
				},
			};
		},
		onLoad() {
			console.log(this.dataL)
		},
		watch: {
			
		},
		methods: {
			goIndex(id){
				if(id==1){
					// console.log(id)
					uni.navigateTo({
						
						url: '/pages/me/mentalTest/list'
					})
				}
			else if(id==2){
				// console.log(id)
				uni.navigateTo({
					url: '/pages/zhengnian/zhengnianvideo'
				})
			}
				
			}
		}
	};
</script>

<style lang="scss" scoped>
	.container {
		background-color: #f2f2f2;
		width: 100%;
		height: 100%;

		.bannerBox {
			width: 100%;

			image {
				width: 100%;
			}
		}
	}
</style>
